bitkeeper revision 1.22.2.16 (3e4a8d2aTphYwwULlRL1UC7BPu-ezQ)
authorsmh22@boulderdash.cl.cam.ac.uk <smh22@boulderdash.cl.cam.ac.uk>
Wed, 12 Feb 2003 18:06:34 +0000 (18:06 +0000)
committersmh22@boulderdash.cl.cam.ac.uk <smh22@boulderdash.cl.cam.ac.uk>
Wed, 12 Feb 2003 18:06:34 +0000 (18:06 +0000)
rest of previous checkin

19 files changed:
xen-2.4.16/Rules.mk
xen-2.4.16/arch/i386/entry.S
xen-2.4.16/arch/i386/setup.c
xen-2.4.16/common/event.c
xen-2.4.16/drivers/Makefile
xen-2.4.16/drivers/block/ll_rw_blk.c
xen-2.4.16/drivers/ide/ide-disk.c
xen-2.4.16/drivers/ide/ide-probe.c
xen-2.4.16/drivers/ide/ide-taskfile.c
xen-2.4.16/drivers/ide/ide.c
xen-2.4.16/drivers/net/Makefile
xen-2.4.16/include/hypervisor-ifs/block.h
xen-2.4.16/include/hypervisor-ifs/hypervisor-if.h
xen-2.4.16/include/xeno/blkdev.h
xen-2.4.16/include/xeno/config.h
xen-2.4.16/include/xeno/sched.h
xenolinux-2.4.16-sparse/arch/xeno/drivers/block/Makefile
xenolinux-2.4.16-sparse/drivers/block/ll_rw_blk.c
xenolinux-2.4.16-sparse/include/asm-xeno/hypervisor.h

index 8bea78943915a9c252733f62388f7b94adffd4f6..33fb3d314bf7e07e76fc2fd5e84d2c3a5e5e0398 100644 (file)
@@ -15,6 +15,7 @@ OBJS    += $(patsubst %.c,%.o,$(C_SRCS))
 # Note that link order matters!
 ALL_OBJS := $(BASEDIR)/common/common.o
 ALL_OBJS += $(BASEDIR)/net/network.o
+ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
 ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
 ALL_OBJS += $(BASEDIR)/drivers/net/driver.o
 ALL_OBJS += $(BASEDIR)/drivers/block/driver.o
index a26c96ccc1a69d0b86a899bee33c829e72ffa37d..ec9e2d100de4bea0fd185eb0b9077da2eb1525e2 100644 (file)
@@ -524,6 +524,7 @@ ENTRY(hypervisor_call_table)
         .long SYMBOL_NAME(kill_domain)
         .long SYMBOL_NAME(do_dom0_op)
         .long SYMBOL_NAME(do_network_op)
+        .long SYMBOL_NAME(do_block_io_op)
         .long SYMBOL_NAME(do_set_debugreg)
         .long SYMBOL_NAME(do_get_debugreg)
         .long SYMBOL_NAME(do_update_descriptor)
index a03c4bac4d1296b9be8be37720ddb06b647f0dc5..57d3f93a7bd3196e06e7ce5cece6c27c1a57ff6d 100644 (file)
@@ -282,6 +282,9 @@ void __init start_of_day(void)
     extern void init_timervecs(void);
     extern int  setup_network_devices(void);
     extern void net_init(void);
+    extern void initialize_block_io(void);
+    extern void initialize_serial(void);
+    extern void initialize_keyboard(void);
 
     unsigned long low_mem_size;
     
@@ -333,9 +336,15 @@ void __init start_of_day(void)
     pci_init();
 #endif
     do_initcalls();
+
+    initialize_serial();   /* setup serial 'driver' (for debugging) */
+    initialize_keyboard(); /* setup keyboard (also for debugging) */
+
     if ( !setup_network_devices() )
         panic("Must have a network device!\n");
-    net_init(); /* initializes virtual network system. */
+    net_init();            /* initializes virtual network system. */
+    initialize_block_io(); /* setup block devices */
+
 
 #ifdef CONFIG_SMP
     wait_init_idle = cpu_online_map;
index 6a81c63f8bf43a6571c3743f84431aac99bdc769..4514d02eb3ef3a42068db335a71f6cc255c8c72a 100644 (file)
@@ -15,13 +15,15 @@ typedef void (*hyp_event_callback_fn_t)(void);
 
 extern void schedule(void);
 extern void flush_rx_queue(void);
+extern void flush_blk_queue(void);
 
 /* Ordering must match definitions of _HYP_EVENT_* in xeno/sched.h */
 static hyp_event_callback_fn_t event_call_fn[] = 
 {
     schedule,
     flush_rx_queue,
-    kill_domain
+    kill_domain, 
+    flush_blk_queue
 };
 
 /* Handle outstanding events for the currently-executing domain. */
index 5aa320fcbe4bae8cf00880291bd23eaf0e044be7..bee17fa208de0f9e903d3002e68dd9c82ded80cc 100644 (file)
@@ -1,12 +1,16 @@
 
 default:
+       $(MAKE) -C char
        $(MAKE) -C pci
        $(MAKE) -C net
        $(MAKE) -C block
        $(MAKE) -C ide
+#      $(MAKE) -C scsi
 
 clean:
+       $(MAKE) -C char clean
        $(MAKE) -C pci clean
        $(MAKE) -C net clean
        $(MAKE) -C block clean
        $(MAKE) -C ide clean
+#      $(MAKE) -C scsi clean
index 0ee8477c71f71a1abafe16cc53af4e66c58047f6..06d9fb72e942a6177e41bfddb6f1fb7afc558f72 100644 (file)
 #include <xeno/slab.h>
 #include <xeno/module.h>
 
+static void end_buffer_dummy(struct buffer_head *bh, int uptodate)
+{
+  /* do nothing */
+}
+
 /* This will die as all synchronous stuff is coming to an end */
-#define end_buffer_io_sync NULL
 #define complete(_r) panic("completion.h stuff may be needed...")
 
 /*
@@ -307,10 +311,14 @@ static void generic_plug_device(request_queue_t *q, kdev_t dev)
  */
 static inline void __generic_unplug_device(request_queue_t *q)
 {
+  /*   printk(KERN_ALERT "__generic_unplug_device %p %d\n", q, q->plugged); */
        if (q->plugged) {
                q->plugged = 0;
                if (!list_empty(&q->queue_head))
+                 {
+                   /*              printk(KERN_ALERT " calling %p\n", q->request_fn); */
                        q->request_fn(q);
+                 }
        }
 }
 
@@ -319,6 +327,8 @@ void generic_unplug_device(void *data)
        request_queue_t *q = (request_queue_t *) data;
        unsigned long flags;
 
+       /*      printk(KERN_ALERT "generic_unplug_device\n"); */
+
        spin_lock_irqsave(&io_request_lock, flags);
        __generic_unplug_device(q);
        spin_unlock_irqrestore(&io_request_lock, flags);
@@ -856,6 +866,8 @@ static int __make_request(request_queue_t * q, int rw,
        int latency;
        elevator_t *elevator = &q->elevator;
 
+       /*      printk(KERN_ALERT "__make_request\n");*/
+
        count = bh->b_size >> 9;
        sector = bh->b_rsector;
 
@@ -1061,6 +1073,8 @@ void generic_make_request (int rw, struct buffer_head * bh)
        int minorsize = 0;
        request_queue_t *q;
 
+       /*      printk(KERN_ALERT "generic_make_request\n"); */
+
        if (!bh->b_end_io)
                BUG();
 
@@ -1130,6 +1144,8 @@ void submit_bh(int rw, struct buffer_head * bh)
 {
        int count = bh->b_size >> 9;
 
+       /*      printk(KERN_ALERT "submit_bh\n"); */
+
        if (!test_bit(BH_Lock, &bh->b_state))
                BUG();
 
@@ -1141,7 +1157,7 @@ void submit_bh(int rw, struct buffer_head * bh)
         * further remap this.
         */
        bh->b_rdev = bh->b_dev;
-       bh->b_rsector = bh->b_blocknr * count;
+       /*      bh->b_rsector = bh->b_blocknr * count; */
 
        generic_make_request(rw, bh);
 
@@ -1194,6 +1210,8 @@ void ll_rw_block(int rw, int nr, struct buffer_head * bhs[])
        int correct_size;
        int i;
 
+       /*      printk(KERN_ALERT "ll_rw_block %d %d\n", rw, nr); */
+
        if (!nr)
                return;
 
@@ -1229,14 +1247,14 @@ void ll_rw_block(int rw, int nr, struct buffer_head * bhs[])
 
                /* We have the buffer lock */
                atomic_inc(&bh->b_count);
-               bh->b_end_io = end_buffer_io_sync;
+               bh->b_end_io = end_buffer_dummy;
 
                switch(rw) {
                case WRITE:
                        if (!atomic_set_buffer_clean(bh))
                                /* Hmmph! Nothing to write */
                                goto end_io;
-                       __mark_buffer_clean(bh);
+                       /* __mark_buffer_clean(bh); */
                        break;
 
                case READA:
@@ -1302,6 +1320,7 @@ int end_that_request_first (struct request *req, int uptodate, char *name)
                req->bh = bh->b_reqnext;
                bh->b_reqnext = NULL;
                bh->b_end_io(bh, uptodate);
+               end_block_io_op(bh);
                if ((bh = req->bh) != NULL) {
                        req->hard_sector += nsect;
                        req->hard_nr_sectors -= nsect;
index 984e53cd67b61321a87f45b014c4a0a74ba93c25..0d1cd113cdc3690bcee0d6149a5ff0ecd251f695 100644 (file)
@@ -420,13 +420,13 @@ static ide_startstop_t chs_rw_disk (ide_drive_t *drive, struct request *rq, unsi
        taskfile.device_head    |= drive->select.all;
        taskfile.command        = command;
 
-#ifdef DEBUG
+       /* #ifdef DEBUG */
        printk("%s: %sing: ", drive->name, (rq->cmd==READ) ? "read" : "writ");
        if (lba)        printk("LBAsect=%lld, ", block);
        else            printk("CHS=%d/%d/%d, ", cyl, head, sect);
        printk("sectors=%ld, ", rq->nr_sectors);
        printk("buffer=0x%08lx\n", (unsigned long) rq->buffer);
-#endif
+       /* #endif*/
 
        memcpy(args.tfRegister, &taskfile, sizeof(struct hd_drive_task_hdr));
        memcpy(args.hobRegister, &hobfile, sizeof(struct hd_drive_hob_hdr));
@@ -578,7 +578,8 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsig
                        tasklets[9] = (task_ioreg_t) 0;
 //                     tasklets[8] = (task_ioreg_t) (block>>32);
 //                     tasklets[9] = (task_ioreg_t) (block>>40);
-#ifdef DEBUG
+                       /*#ifdef DEBUG */
+                       printk("[A]\n");
                        printk("%s: %sing: LBAsect=%lu, sectors=%ld, buffer=0x%08lx, LBAsect=0x%012lx\n",
                                drive->name,
                                (rq->cmd==READ)?"read":"writ",
@@ -590,7 +591,7 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsig
                                drive->name, tasklets[3], tasklets[2],
                                tasklets[9], tasklets[8], tasklets[7],
                                tasklets[6], tasklets[5], tasklets[4]);
-#endif
+                       /* #endif */
                        OUT_BYTE(tasklets[1], IDE_FEATURE_REG);
                        OUT_BYTE(tasklets[3], IDE_NSECTOR_REG);
                        OUT_BYTE(tasklets[7], IDE_SECTOR_REG);
@@ -1320,6 +1321,10 @@ static void idedisk_setup (ide_drive_t *drive)
        
        struct hd_driveid *id = drive->id;
        unsigned long capacity;
+
+       printk (KERN_ALERT
+               "ide-disk.c::idedisk_setup: chs %d %d %d\n",
+               drive->cyl, drive->head, drive->sect);
        
        idedisk_add_settings(drive);
 
@@ -1383,7 +1388,7 @@ static void idedisk_setup (ide_drive_t *drive)
        if ((capacity >= (drive->bios_cyl * drive->bios_sect * drive->bios_head)) &&
            (!drive->forced_geom) && drive->bios_sect && drive->bios_head)
                drive->bios_cyl = (capacity / drive->bios_sect) / drive->bios_head;
-       printk (KERN_INFO "XEN %s: %ld sectors", drive->name, capacity);
+       printk (KERN_INFO "[XEN] %s: %ld sectors", drive->name, capacity);
 
        /* Give size in megabytes (MB), not mebibytes (MiB). */
        /* We compute the exact rounded value, avoiding overflow. */
index e83157ec01b6301953528ed9fdd7c6d8844c38ba..99f38dfcb8fd88b2b3ae80c43f098ab05e55f456 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
+#define IDE_PROBE_TRACE 0
+
 static inline void do_identify (ide_drive_t *drive, byte cmd)
 {
        int bswap = 1;
        struct hd_driveid *id;
 
+       if (IDE_PROBE_TRACE)
+       {
+         printk (KERN_ALERT "ide-probe::do_identify\n");
+       }
+
        id = drive->id = kmalloc (SECTOR_WORDS*4, GFP_ATOMIC);  /* called with interrupts disabled! */
        if (!id) {
                printk(KERN_WARNING "(ide-probe::do_identify) Out of memory.\n");
@@ -201,6 +208,11 @@ static int actual_try_to_identify (ide_drive_t *drive, byte cmd)
        unsigned long timeout;
        byte s, a;
 
+       if (IDE_PROBE_TRACE)
+       {
+         printk (KERN_ALERT "ide-probe::actual_try_to_identify\n");
+       }
+
        if (IDE_CONTROL_REG) {
                /* take a deep breath */
                ide_delay_50ms();
@@ -260,6 +272,11 @@ static int try_to_identify (ide_drive_t *drive, byte cmd)
        int autoprobe = 0;
        unsigned long cookie = 0;
 
+       if (IDE_PROBE_TRACE)
+       {
+         printk (KERN_ALERT "ide-probe::try_to_identify\n");
+       }
+
        if (IDE_CONTROL_REG && !HWIF(drive)->irq) {
                autoprobe = 1;
                cookie = probe_irq_on();
@@ -314,6 +331,12 @@ static int do_probe (ide_drive_t *drive, byte cmd)
 {
        int rc;
        ide_hwif_t *hwif = HWIF(drive);
+
+       if (IDE_PROBE_TRACE)
+       {
+         printk (KERN_ALERT "ide-probe::do_probe\n");
+       }
+
        if (drive->present) {   /* avoid waiting for inappropriate probes */
                if ((drive->media != ide_disk) && (cmd == WIN_IDENTIFY))
                        return 4;
@@ -372,6 +395,11 @@ static void enable_nest (ide_drive_t *drive)
 {
        unsigned long timeout;
 
+       if (IDE_PROBE_TRACE)
+       {
+         printk (KERN_ALERT "ide-probe::enable_nest\n");
+       }
+
        printk("%s: enabling %s -- ", HWIF(drive)->name, drive->id->model);
        SELECT_DRIVE(HWIF(drive), drive);
        ide_delay_50ms();
@@ -402,6 +430,11 @@ static void enable_nest (ide_drive_t *drive)
  */
 static inline byte probe_for_drive (ide_drive_t *drive)
 {
+  if (IDE_PROBE_TRACE)
+  {
+    printk (KERN_ALERT "ide-probe::probe_for_drive\n");
+  }
+
        if (drive->noprobe)                     /* skip probing? */
                return drive->present;
        if (do_probe(drive, WIN_IDENTIFY) >= 2) { /* if !(success||timed-out) */
@@ -500,6 +533,11 @@ static void probe_hwif (ide_hwif_t *hwif)
        unsigned int unit;
        unsigned long flags;
 
+  if (IDE_PROBE_TRACE)
+  {
+    printk (KERN_ALERT "ide-probe::probe_hwif\n");
+  }
+
        if (hwif->noprobe)
                return;
 #ifdef CONFIG_BLK_DEV_IDE
@@ -978,6 +1016,11 @@ int ideprobe_init (void)
 {
        unsigned int index;
        int probe[MAX_HWIFS];
+
+  if (IDE_PROBE_TRACE)
+  {
+    printk (KERN_ALERT "ide-probe::ideprobe_init\n");
+  }
        
        MOD_INC_USE_COUNT;
        memset(probe, 0, MAX_HWIFS * sizeof(int));
index 34bfacebfe968daaf3748bd8f9ae0d16c5347d05..578af551566250f9b407547bfdd451246abacea3 100644 (file)
@@ -171,6 +171,8 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
        struct hd_driveid *id = drive->id;
        byte HIHI = (drive->addressing) ? 0xE0 : 0xEF;
 
+       printk(KERN_ALERT "do_rw_taskfile\n");
+
        /* (ks/hs): Moved to start, do not use for multiple out commands */
        if (task->handler != task_mulout_intr) {
                if (IDE_CONTROL_REG)
index af3694bf8583592f04f969d58171ed2d67d6a648..51cee21f775b0af677e3ebc3d1b64e0565bb1034 100644 (file)
@@ -1391,6 +1391,8 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
        block    = rq->sector;
        blockend = block + rq->nr_sectors;
 
+
+#ifdef NEVER
        if ((rq->cmd == READ || rq->cmd == WRITE) &&
            (drive->media == ide_disk || drive->media == ide_floppy)) {
                if ((blockend < block) || (blockend > drive->part[minor&PARTN_MASK].nr_sects)) {
@@ -1404,6 +1406,15 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
           possibly killing some innocent following sector */
        if (block == 0 && drive->remap_0_to_1 == 1)
                block = 1;  /* redirect MBR access to EZ-Drive partn table */
+#endif
+
+#ifdef NEVER_DEBUG
+       {
+         printk("    ide::start_request  %lx %lx  %lx  %lx %lx\n", 
+                rq->sector, rq->nr_sectors, block,
+                drive->part[minor&PARTN_MASK].start_sect, drive->sect0);
+       }
+#endif
 
 #if (DISK_RECOVERY_TIME > 0)
        while ((read_timer() - hwif->last_time) < DISK_RECOVERY_TIME);
@@ -1414,6 +1425,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
                printk("%s: drive not ready for command\n", drive->name);
                return startstop;
        }
+       drive->special.all = 0;
        if (!drive->special.all) {
                switch(rq->cmd) {
                        case IDE_DRIVE_CMD:
index 8b752b9712ec5a338cd7a9d7fc17a18094cf81ac..5b20a6c8c92e912c62ab73a35d34b1f99e32d01c 100644 (file)
@@ -4,13 +4,11 @@ include $(BASEDIR)/Rules.mk
 default: $(OBJS)
        $(MAKE) -C ne
        $(MAKE) -C tulip
-       $(MAKE) -C e1000
-       $(LD) -r -o driver.o $(OBJS) tulip/tulip.o e1000/e1000.o ne/ne_drv.o
+       $(LD) -r -o driver.o $(OBJS) tulip/tulip.o ne/ne_drv.o
 
 clean:
        $(MAKE) -C ne clean
        $(MAKE) -C tulip clean
-       $(MAKE) -C e1000 clean
        rm -f *.o *~ core
 
 .PHONY: default clean
index 55f7a33ce24d21e2be809c6da78223f8a7f77875..1722a6c2881341afcd5ab89c1b1d895a73b14dc5 100644 (file)
@@ -6,35 +6,80 @@
  * These are the ring data structures for buffering messages between 
  * the hypervisor and guestos's.  
  *
- * For now we'll start with our own rings for the block IO code instead
- * of using the network rings.  Hopefully, this will give us additional
- * flexibility in the future should we choose to move away from a 
- * ring producer consumer communication model.
  */
 
 #ifndef __BLOCK_H__
 #define __BLOCK_H__
 
-typedef struct blk_tx_entry_st {
-       unsigned long addr; /* virtual address */
-       unsigned long size; /* in bytes */
-} blk_tx_entry_t;
+#include <linux/kdev_t.h>
 
-typedef struct blk_rx_entry_st {
-       unsigned long addr; /* virtual address */
-       unsigned long size; /* in bytes */
-} blk_rx_entry_t;
+/* the first four definitions match fs.h */
+#define XEN_BLOCK_READ  0
+#define XEN_BLOCK_WRITE 1
+#define XEN_BLOCK_READA 2                                /* currently unused */
+#define XEN_BLOCK_SPECIAL 4                              /* currently unused */
+#define XEN_BLOCK_PROBE 8      /* determine io configuration from hypervisor */
+#define XEN_BLOCK_DEBUG 16                                          /* debug */
 
-typedef struct blk_ring_st {
-       blk_tx_entry_t  *tx_ring;
-       unsigned int    tx_prod, tx_cons, tx_event;
-       unsigned int    tx_ring_size;
+#define XEN_BLOCK_SYNC  2
+#define XEN_BLOCK_ASYNC 3
 
-       blk_rx_entry_t  *rx_ring;
-       unsigned int    rx_prod, rx_cons, rx_event;
-       unsigned int    rx_ring_size;
+#define XEN_BLOCK_MAX_DOMAINS 32  /* NOTE: FIX THIS. VALUE SHOULD COME FROM? */
+
+#define BLK_TX_RING_SIZE 256
+#define BLK_RX_RING_SIZE 256
+
+#define BLK_TX_RING_MAX_ENTRIES (BLK_TX_RING_SIZE - 2)
+#define BLK_RX_RING_MAX_ENTRIES (BLK_RX_RING_SIZE - 2)
+
+#define BLK_TX_RING_INC(_i)    (((_i)+1) & (BLK_TX_RING_SIZE-1))
+#define BLK_RX_RING_INC(_i)    (((_i)+1) & (BLK_RX_RING_SIZE-1))
+#define BLK_TX_RING_ADD(_i,_j) (((_i)+(_j)) & (BLK_TX_RING_SIZE-1))
+#define BLK_RX_RING_ADD(_i,_j) (((_i)+(_j)) & (BLK_RX_RING_SIZE-1))
+
+typedef struct blk_ring_entry 
+{
+  void *          id;                   /* for guest os use; used for the bh */
+  int             priority;         /* orig sched pri, SYNC or ASYNC for now */
+  int             operation;            /* XEN_BLOCK_READ or XEN_BLOCK_WRITE */
+  char *          buffer;
+  unsigned long   block_number;                              /* block number */
+  unsigned short  block_size;                                  /* block size */
+  kdev_t          device;
+  unsigned long   sector_number;             /* real buffer location on disk */
+} blk_ring_entry_t;
+
+typedef struct blk_ring_st 
+{
+  blk_ring_entry_t *tx_ring;
+  unsigned int      tx_prod, tx_cons;
+  unsigned int             tx_ring_size;
+
+  blk_ring_entry_t *rx_ring;
+  unsigned int      rx_prod, rx_cons;
+  unsigned int     rx_ring_size;
 } blk_ring_t;
 
-int blk_create_ring(int domain, unsigned long ptr);
+#define MAX_XEN_DISK_COUNT 100
+
+#define XEN_DISK_IDE  1
+#define XEN_DISK_SCSI 2
+
+typedef struct xen_disk                                     /* physical disk */
+{
+  int           type;                                           /* disk type */
+  unsigned long capacity;
+  unsigned char heads;                               /* hdreg.h::hd_geometry */
+  unsigned char sectors;                             /* hdreg.h::hd_geometry */
+  unsigned int  cylinders;                       /* hdreg.h::hd_big_geometry */
+  unsigned long start;                               /* hdreg.h::hd_geometry */
+  void *        gendisk;                               /* struct gendisk ptr */
+} xen_disk_t;
+
+typedef struct xen_disk_info
+{
+  int         count; /* number of subsequent xen_disk_t structures to follow */
+  xen_disk_t  disks[100];
+} xen_disk_info_t;
 
 #endif
index a0cfc7ae5916de6b097d645ccab6c03f78d8e4ec..ad3c9a5dd8a9ef50be477bf7785d313e8dc78764 100644 (file)
@@ -85,10 +85,11 @@ typedef struct
 #define __HYPERVISOR_exit                  8
 #define __HYPERVISOR_dom0_op               9
 #define __HYPERVISOR_network_op           10
-#define __HYPERVISOR_set_debugreg         11
-#define __HYPERVISOR_get_debugreg         12
-#define __HYPERVISOR_update_descriptor    13
-#define __HYPERVISOR_set_fast_trap        14
+#define __HYPERVISOR_block_io_op          11
+#define __HYPERVISOR_set_debugreg         12
+#define __HYPERVISOR_get_debugreg         13
+#define __HYPERVISOR_update_descriptor    14
+#define __HYPERVISOR_set_fast_trap        15
 
 #define TRAP_INSTR "int $0x82"
 
index 2701eb84e32a16ed2a8b0e18a6d20e6ff4c8a747..f5c1d25d751ef7f44386320558b1cf1dd3cada32 100644 (file)
@@ -85,6 +85,7 @@ struct buffer_head {
 
         struct inode *       b_inode;
         struct list_head     b_inode_buffers;   /* doubly linked list of inode dirty buffers */
+        void *b_xen_request;                        /* xen request structure */
 };
 
 typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
index 637281f64bf2efe77fce3f8eb2dd321748b638b8..d9ffb1d95d97818258aa24d8d782651fafd93054 100644 (file)
@@ -29,6 +29,7 @@
 #define CONFIG_IDEDMA_PCI_AUTO 1
 #define CONFIG_IDEDMA_AUTO 1
 #define CONFIG_BLK_DEV_IDE_MODES 1
+#define CONFIG_BLK_DEV_PIIX 1
 
 #define CONFIG_SCSI 1
 #define CONFIG_BLK_DEV_SD 1
index 6f2863e8a557d4b190f45503fe6644568f94357a..370852af00e0537e826398a3e9987238c70f1424 100644 (file)
@@ -1,4 +1,3 @@
-
 #ifndef _LINUX_SCHED_H
 #define _LINUX_SCHED_H
 
@@ -49,6 +48,7 @@ extern struct mm_struct init_mm;
 #define _HYP_EVENT_NEED_RESCHED 0
 #define _HYP_EVENT_NET_RX       1
 #define _HYP_EVENT_DIE          2
+#define _HYP_EVENT_BLK_RX       3
 
 #define PF_DONEFPUINIT  0x1  /* Has the FPU been initialised for this task? */
 #define PF_USEDFPU      0x2  /* Has this task used the FPU since last save? */
index 9361a01ec7915e3e12a78cba442d7df856559154..74a0c6c5654d8d2e959337db3233b9c9326f4e55 100644 (file)
@@ -1,3 +1,3 @@
 O_TARGET := blk.o
-obj-y := block.o
+obj-y := xl_block.o xl_block_test.o
 include $(TOPDIR)/Rules.make
index a9e973d05f32eb44d09959145f43f4546d8e6872..c6d5c9625bc41e34d360eaa419b682893cabe4b7 100644 (file)
@@ -1227,6 +1227,11 @@ int __init blk_dev_init(void)
 #ifdef CONFIG_SUN_JSFLASH
        jsfd_init();
 #endif
+
+#ifdef CONFIG_XENOLINUX_BLOCK
+    xlblk_init();
+#endif
+
        return 0;
 };
 
index d25c6f8171506e9431f716729639023c72e369fd..8e9ef3eed595b6b6d1562f97843d2e55c20a4bfa 100644 (file)
@@ -257,6 +257,16 @@ static inline int HYPERVISOR_network_op(void *network_op)
     return ret;
 }
 
+static inline int HYPERVISOR_block_io_op(void)
+{
+    int ret;
+    __asm__ __volatile__ (
+        TRAP_INSTR
+        : "=a" (ret) : "0" (__HYPERVISOR_block_io_op) ); 
+
+    return ret;
+}
+
 static inline int HYPERVISOR_set_debugreg(int reg, unsigned long value)
 {
     int ret;